﻿using System;
using System.Windows.Forms;
using CosyTrade.Core;
using CosyTrade.UI;

namespace CosyTrade.Client
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            AddinServices services = AddinServices.Instance;
            services.InitalizeAddin();
            services.StartAddin();

            Operation.CreateInstance();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Blue");

        Lab_Relog:
            LoginForm loginForm = new LoginForm();
            if (DialogResult.OK == loginForm.ShowDialog())
            {
                MainForm mForm = new MainForm();
                Application.Run(mForm);
                if (mForm.ReLogin) goto Lab_Relog;
            }

            services.Stop();
        }
    }
}
